package com.ksd.member;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;


/** 
* 
* @author zbb: 
* @version 2017年9月14日
* 
*/
@RestController
public class MemberController {
	@Autowired
	private MemberDao memberDao;
	
	
	@RequestMapping(value = "/member" , method=RequestMethod.GET)
    public ResponseEntity<?>  getMember(@AuthenticationPrincipal Member user){
		
		
		Member member = memberDao.findOne(96218);
		
		JSONObject jsonObject = new JSONObject();
		jsonObject.put("nickname", member.getNickname());
		return new ResponseEntity<>(jsonObject, HttpStatus.OK);
        
    }
}
